var LogIn = LogIn || {};


$(function () {

    $("#formSubmit").click(function () {
        LogIn.formSubmit($('#loginForm').serialize());
    });

});

LogIn.formSubmit = function (formData) {
    $.ajax({
        type : 'POST',
        url : 'http://127.0.0.1:8889/login',
        data : formData,
        success: function (data) {
            if (data.code == 200) {
                window.location.href = "http://127.0.0.1:8890/index";
            } else {
                alert(data.msg);
            }
        }
    })
}